-
Notifications
You must be signed in to change notification settings - Fork 22.7k
ARIA heading role: aria-level is required #39482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
See the [ARIA 1.3 specification for heading](https://www.w3.org/TR/wai-aria-1.3/#heading): > To ensure elements with a role of heading are organized into a logical outline, authors MUST use the aria-level attribute to indicate the proper nesting level.
defaulting to a level of 2 is how the role was previously spec'd, and it is what browsers are instructed to do to mitigate author error for not requiring a level. see in section 9.2 States and Properties, the Fallback values for missing required attributes table. it's listed there that level 2 is the fallback value for an undefined aria-level on an element with a role of heading |
@@ -27,7 +27,7 @@ This defines the text in the `<div>` to be the main heading of the page, indicat | |||
### Associated WAI-ARIA roles, states, and properties | |||
|
|||
- [`aria-level`](/en-US/docs/Web/Accessibility/ARIA/Reference/Attributes/aria-level) | |||
- : The `aria-level` attribute specifies the heading level in the document structure. If no level is present, a value of 2 is the default. | |||
- : The `aria-level` attribute specifies the heading level in the document structure. This attribute is required: authors must indicate the proper nesting level, to ensure elements with a role of heading are organized into a logical outline. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- : The `aria-level` attribute specifies the heading level in the document structure. This attribute is required: authors must indicate the proper nesting level, to ensure elements with a role of heading are organized into a logical outline. | |
- : The `aria-level` attribute specifies the heading level in the document structure. This attribute is required: authors must indicate the proper nesting level to ensure elements with a `role` of `heading` are organized into a logical outline. |
Thanks for the explanation, @scottohara. I will update the pull request with an explanation that, if the required attribute is not specified, then a fallback value of 2 will be specified. |
Description
Changes the description of the ARIA heading role’s aria-level attribute to state that it is required, rather than stating that it defaults to 2.
Motivation
See the ARIA 1.3 specification for heading:
Additional details
The MDN page on the aria-level role already states that the heading role is required.
I’m not sure where the “If no level is present, a value of 2 is the default” claim comes from.
Related issues and pull requests
None.